<html lang="en">
<head>

    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>风险预警系统</title>
    <link rel="stylesheet" type="text/css" href="../static/ui/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../static/ui/static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../static/ui/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../static/ui/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../static/ui/static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../static/css/out.css"/>
    <style>
        .hide {
            display: none;
        }
    </style>
    <script type="text/javascript">
        var region = {
            "反洗钱":
                {
                    "": [""],
                    "黑名单": ["", "黑名单一致性", "黑名单实时监控"],

                    "客户风险等级": ["", "首次评估", "定期评估", "客户风险等级唯一性", ""],

                    "可疑交易": ["", "可疑交易定性意见留痕", "可疑交易上报及时性"],
                    "法人客户": ["", "身份要素信息完整性"],
                    "个人客户": ["", "身份证件有效期"]
                },
            "财务":
                {
                    "": [""],
                    "赔付差异": ["", "财务支付金额与业务金额不一致", "核赔不通过，财务表显示已支付成功", "财务表显示已支付，理赔端无对应数据", "理赔业务表中未包含公估费", "财务支出时间比理赔业务表时间提前", "理赔主表中的总支付金额小于理赔业务表中的总支付金额"]

                }
        }

    </script>
</head>
<body>
<nav class="breadcrumb"><i id="logo"></i> <a class="btn btn-success radius r"
                                             style="line-height:1.6em;margin-top:3px"
                                             href="javascript:location.replace(location.href);"
                                             title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="page-container">

    <div class="text-c">

        <select id="province" onchange="change(this.value);" class="select-box" style="width:200px;">
            <option>请选择一级指标</option>
        </select>

        <select id="city" onchange="countyChange(this.value);" class="select-box" style="width:200px;">
            <option>请选择二级指标</option>
        </select>

        <select id="county" class="select-box" style="width:200px;">
            <option>请选择三级指标</option>
        </select>

        <span>   查询数据范围</span>
        <input type="text"
               onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd',isShowToday:false,isShowClear:false })"
               id="datemin"
               class="input-text Wdate" style="width:300px;">
        -
        <input type="text"
               onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',isShowToday:false,isShowClear:false })"
               id="datemax"
               class="input-text Wdate" style="width:300px;">

        <button type="button" class="btn btn-success radius" id="tijiao" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索
        </button>

    </div>

    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg thisTable">
            <thead>
            <tr class="text-c">
                <th>序号</th>
                <th>指标名称</th>
                <th>指标日期</th>
                <th>监控状态</th>
                <th>下载</th>
            </tr>
            </thead>

            <tbody id="tbody" class="text-c">

            </tbody>
        </table>

        <div id="page1" class="r pager" style="margin-top: 10px"></div>
        <div style="font-size: 18px; font-family: 宋体; margin-top: 5px">监控状态：1--预警  0--正常</div>
    </div>
</div>

<!--_footer-->
<script type="text/javascript" src="../static/ui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../static/ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="../static/ui/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="../static/ui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer-->
<script src='../static/js/threelevellinkpage.js'></script>
<!--业务代码-->
<script type="text/javascript" src="../static/ui/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="../static/ui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../static/ui/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">


    $(function () {
        $('#DataTables_Table_0_length').hide();
        $('#DataTables_Table_0_filter').hide();
        $('#DataTables_Table_0_previous').hide();
        $('#DataTables_Table_0_next').hide();
        $('#DataTables_Table_0_info').hide();
        core.getUserListByPage();
        $("#tijiao").click(function () {
            var datemin = $("#datemin").val();
            var datemax = $("#datemax").val();
            var province = $("#province").val();
            var city = $("#city").val();
            var county = $("#county").val();

            core.getUserListByPage(datemin, datemax, province, city, county);

        });



    });
    var core = (function ($$) {
        var getRootPath = function () {
            var curWwwPath = window.document.location.href;
            var pathName = window.document.location.pathname;
            var pos = curWwwPath.indexOf(pathName);
            var localhostPath = curWwwPath.substring(0, pos);
            var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
            return (localhostPath + projectName);
        };
        var getPage = function (url, config, content) {
            $.getJSON(url, config, function (res) {
                $('#theme-count').html(res.totalPeo)
                laypage({
                    cont: 'page1',
                    pages: Math.ceil(res.total / config.pageSize),
                    curr: config.page || 1,
                    group: 10,
                    skip: true,
                    jump: function (obj, first) {
                        if (!first) {
                            config.page = obj.curr;
                            getPage(url, config, content)
                        }

                    }
                });
                $('tbody').html(content(res, config.page))
            });
        };

        function parseUserList(res, currPage) {
            var content = "";
            if (res.total > 0) {
                var i = 1;
                $.each(res.rows, function (i, o) {
                    content += "<tr class=\"text-c\">";
                    content += "<td width=\"10\" title='" + o.id + "'>" + o.curr_page + "</td>";
                    content += "<td width=\"10\" title='" + o.target + "'>" + o.target + "</td>";
                    content += "<td width=\"10\" title='" + o.monitor_date + "'>" + o.monitor_date + "</td>";
                    content += "<td width=\"10\" title='" + o.monitir_status + "'>" + o.monitir_status + "</td>";
                    {#content += "<td width=\"10\"" + "id='" +o.target+ o.monitor_date+ ".xls" + "'" + "title='" + o.monitor_dpwnload + "'>" + "<button type=\"button\" class=\"btn btn-secondary radius loadExcel\" id=\"loadExcel\" name=\"\" href=\"\"><i class=\"Hui-iconfont\">&#xe640;</i>导出EXCEL\n" + "</button>" + o.monitor_dpwnload + "</td>";#}
                    content += "<td width=\"10\"" + "id='" + o.target + o.monitor_date + ".xls" + "'" + "title='" + o.monitor_dpwnload + "'>" + "<a href=\"http://127.0.0.1:5000/download_xls?code_n=" + o.monitor_dpwnload + "\"><button type=\"button\" class=\"btn btn-secondary radius loadExcel " + o.hide_h + "\" id=\"loadExcel\" ><i class=\"Hui-iconfont\">&#xe640;</i>导出EXCEL\n" + "</button></a>" + "</td>";

                    content += "</tr>";
                });
                $('.laypage_main ').show();
                return content;
            } else {
                content += "<tr class='odd'>"
                content += "<td valign=\"top\" colspan=\"12\" class=\"dataTables_empty\">没有数据</td>"
                content += "</tr>"
                $('.laypage_main ').hide();
                return content;
            }
        }

        var getUserListByPage = function (datemin, datemax, province, city, county, curr) {
            core.getPage(core.getRootPath() + '/log_mysql_data?', {
                page: curr || 1,
                pageSize: 10,
                datemin: datemin,
                datemax: datemax,
                province: province,
                city: city,
                county: county,
            }, parseUserList);
        };

        return {
            getRootPath: getRootPath,
            getPage: getPage,
            getUserListByPage: getUserListByPage
        }
    })(jQuery);


</script>

</body>
</html>